<template>
	<view class="buy_box">
		<!-- 表单提交展示相关 -->
		<u-list :height=300>
			<u-list-item>
				{{info.age}}
			</u-list-item>
		</u-list>
		<u-popup :show="show" @close="close" @open="open" mode="center">
			<view class="u-popup-slot" :style="{
					width: ['bottom', 'top'].includes(popupData.mode) ? '750rpx' : '200px',
					marginTop: ['left', 'right'].includes(popupData.mode) ? '480rpx' : '0',
				}">
				<text class="info">这里是脚本显示这里是脚本显示这里是脚本显示这里是脚本显示这里是脚本显示这里是脚本显示这里是脚本显示</text>

			</view>
			<button type="primary" text="点我关闭" customStyle="width: 200rpx" @click="show = !show"></button>
		</u-popup>
		<button type="primary" @click="show=true;">查看脚本</button>
		<text>价格：200元</text>
		<!-- 提出修改建议 -->
		<view class="example-body dialog">
			<view class="dialog-box">
				<text class="dialog-text">输入内容：{{value}}</text>
			</view>
			<button class="button" type="primary" @click="confirmDialog" size='mini'><text class="button-text">不满意</text></button>
			<button  type="primary" size="mini" @click="toBuy"><text>满意</text></button>
		</view>
		<uni-popup id="dialogInput" ref="dialogInput" type="dialog">
			<uni-popup-dialog mode="input" title="输入内容" placeholder="请输入修改意见" @confirm="dialogInputConfirm">
			</uni-popup-dialog>
		</uni-popup>
	</view>

	<!-- <view>uni-ui
		<button @click="open">查看脚本</button>
		<uni-popup ref="popup" type="bottom">这里是脚本</uni-popup>
	</view> -->

</template>

<script>
	export default {
		data() {
			return {
				//表单传过来的数据
				info: '',
				show: false,
				value: '',
				popupData: {
					mode: "bottom",
				}
			};
		},
		onLoad(options) {
			if (options.list != null) {
				this.info = JSON.parse(options.list)
				console.log(this.info)
			}

		},
		methods: {
			/**
			 * 输入对话框的确定事件
			 */
			dialogInputConfirm(val) {
				console.log(val);
				this.value = val
				
			},
			/**
			 * 对话框取消按钮
			 */
			dialogClose() {
				this.msgType = 'info'
				this.message = '点击了对话框的取消按钮'
				this.$refs.popupMessage.open()
				// 需要执行 done 才能关闭对话框
				
			},
			toBuy(){
				uni.navigateTo({
					url:"../pay/pay"
				})
			},
			confirmDialog() {
				this.$refs.dialogInput.open()
			},
			
			close() {
				this.show = false
				// console.log('close');
			},

		}

	}
</script>

<style lang="scss">
	.buy_box {
		.u-popup-slot {
			width: 200px;
			height: 150px;
			@include flex;
			justify-content: center;
			align-items: center;
			 
			.info {
				padding: 0 30rpx;
			}
		}
	}
</style>
-->
